import fetch from '@/utils/fetch'

export function apiGetOutsourcerList(listQuery) {
  return fetch({
    url: '/api/v1/outsourcer/list',
    method: 'get',
    params: listQuery
  })
}

export function apiGetOutsourcerById(outsourcerId) {
  return fetch({
    url: '/api/v1/outsourcer',
    method: 'get',
    params: {
      id: outsourcerId
    }
  })
}

export function apiAddOutsourcer(outsourcerDto) {
  return fetch({
    url: '/api/v1/outsourcer',
    method: 'post',
    data: outsourcerDto
  })
}

export function apiUpdOutsourcer(OutsourcerDto) {
  return fetch({
    url: '/api/v1/outsourcer',
    method: 'put',
    data: OutsourcerDto
  })
}

export function apiDelOutsourcer(outsourcerId) {
  return fetch({
    url: '/api/v1/outsourcer',
    method: 'delete',
    params: {
      id: outsourcerId
    }
  })
}

export function apiExport (listQuery) {
  return fetch({
    url: '/api/v1/outsourcer/export',
    method: 'post',
    data: listQuery,
    responseType: 'arraybuffer'
  })
}
